<template>
    <el-menu :default-openeds="['1', '3']" style="height: 100%;overflow: hidden"
             background-color="rgb(48,60,86)"
             text-color="#fff"
             active-text-color="#fff04b"
             :collapse-transition="false"
             :collapse="isCollapse"
             router
    >
        <div style="height: 60px; line-height: 60px;text-align: center">
            <img src="../assets/root.png" style="width: 40px;height:40px;position: relative; top: 5px; margin-right: 5px;border-radius: 40%">
            <b style="color: white" v-show="logoTextShow">助农管理系统</b>
        </div>

        <el-menu-item index="/home">
            <template slot="title">
                <i class="el-icon-s-home"></i>
                <span slot="title">首页</span>
            </template>
        </el-menu-item>

        <el-menu-item v-if="user" index="/verify">
            <template slot="title">
                <i class="el-icon-s-home"></i>
                <span slot="title">订单审核</span>
            </template>
        </el-menu-item>

        <el-menu-item v-if="user" index="/user">
            <template slot="title">
                <i class="el-icon-chat-line-square"></i>
                <span slot="title">农户列表</span>
            </template>
        </el-menu-item>

        <el-submenu v-if="!user" index="1">
            <template slot="title"><i class="el-icon-watermelon"></i>上架商品</template>
        <el-menu-item-group>
                <el-menu-item index="/Meat">活禽肉蛋</el-menu-item>
                <el-menu-item index="/Vegetable">果蔬五谷</el-menu-item>
                <el-menu-item index="/Seafood">海鲜干货</el-menu-item>
        </el-menu-item-group>
        </el-submenu>

        <el-submenu v-if="!user" index="2">
            <template slot="title"><i class="el-icon-notebook-2"></i>订单列表</template>
            <el-menu-item-group>
                <el-menu-item index="/orderDetail">订单详情</el-menu-item>
            </el-menu-item-group>
        </el-submenu>

        <el-submenu v-if="!user" index="3">
                <template slot="title"><i class="el-icon-notebook-2"></i>收益/仓库视图</template>
            <el-menu-item-group>
                <el-menu-item index="/Warehouse">仓库</el-menu-item>
                <el-menu-item index="/EarnView">收益视图</el-menu-item>
            </el-menu-item-group>
        </el-submenu>

        <el-menu-item v-if="!user" index="/message">
            <template slot="title">
                <i class="el-icon-chat-line-square"></i>
                <span slot="title">短信通知</span>
            </template>
        </el-menu-item>

    </el-menu>
</template>

<script>
export default {
name: "Aside",
    props: {
        isCollapse: Boolean,
        logoTextShow: Boolean
    },
    data(){
        console.log("@@@",JSON.stringify(localStorage.getItem("userName")),localStorage.getItem("userName")=='admin'?true:false)
    return{
        user:localStorage.getItem("userName")=='admin'?true:false
    };
    }
}
</script>


<style scoped>

</style>
